<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>video</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="css/resource.css" />
	<link type="text/css" rel="stylesheet" href="../../css/pepper-grinder/jquery-ui-1.8.16.custom.css" />
	<link type="text/css" rel="stylesheet" href="../../css/popeWin.css" />
	<script type="text/javascript" src="../../js/jquery.min.js"></script>
	<script type="text/javascript" src="../../js/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.mousewheel.min.js"></script>
	<script type="text/javascript" src="../../js/popeScroll.js"></script>
	<script type="text/javascript" src="js/jquery.tabswitch.js"></script>
	<script type="text/javascript" src="../../js/popeWin.js"></script>
	<script language="JavaScript" type="text/JavaScript">
	var tabnum = 0;
	var maxtabnum = 1;
	$(document).ready(function() {
		$(window).resize(function() {
			refresh();
		});	
		refresh();
		var parwinwidth = $(window.parent).width();
		var parwinheight = $(window.parent).height();
		$("#leftButton,#rightButton").hover(function(){
			$(this).removeClass("transparent_0");
			$(this).addClass("transparent_class");
		},function(){
			$(this).removeClass("transparent_class");
			$(this).addClass("transparent_0");
		});
		$(".subtab").tabSwitch("create", {type: "slide", height: parwinheight*0.8, width: parwinwidth/2-5},function(){});
		
		$.getJSON("resource_getResources.do",{num:1,resourceType:"1"},function(json){
			var res = json[0];
			$("#user_info .user_info").text(res.userName+"&nbsp;&nbsp;&nbsp;发表了新小说&nbsp;&nbsp;&nbsp;"+res.time);
			refresh();
		});

		$("#con_1").popeScroll({
			offset_top:-300,
			top:25,
			mousewheelBox:"tabscontent"
		});
	});
	function refresh(){
		var winheight = $(window).height();
		var winwidth = $(window).width();
		
		$("#bodydiv").css("height",winheight);
		$(".subtab").css("height",winheight-5);
		$("#con_1").css("height",winheight-45);
		$("#con_2").css("height",winheight-45);
	}
	
	function changeTab(num){
		var tmp = tabnum + num;
		
		if(tmp < 0|| tmp > maxtabnum){
			return;
		}
		tabnum = tmp;
		var index = tabnum+1;
		$(".popeScroll").hide();
		var $scroll = $("#scroll_con_"+index);
		if($scroll.length==0){
			
			$("#con_"+index).popeScroll({
				offset_top:-300,
				top:25,
				mousewheelBox:"tabscontent"
			});
		}else{
			$scroll.show();
		}
		$(".subtab").tabSwitch("moveTo",{index: tabnum},function(){});
	}
	
	function changeType(obj){
		$(".con_div").hide();
		$("#div_"+obj.value).show();
	}
	
	function sub(){
		var params;
		var resourceType = $("#resourceType").val();
		alert(resourceType);
		if(resourceType==1){
			params = {
				"resourceType":resourceType,
				"author":$("#book_author").val(),
				"chapter":$("#book_chapter").val(),
				"content":$("#book_content").val(),
				"descp":$("#book_descp").val(),
				"title":$("#book_title").val()
			};
		}else if(resourceType==2){
			params = {
				"resourceType":resourceType,
				"author":$("#comic_author").val(),
				"chapter":$("#comic_chapter").val(),
				"urls":$("#comic_urls").val(),
				"descp":$("#comic_descp").val(),
				"title":$("#comic_title").val()
			};
		}else if(resourceType==3){
			params = {
				"resourceType":resourceType,
				"urls":$("#music_urls").val(),
				"descp":$("#music_descp").val(),
				"title":$("#music_title").val()
			};
		}else if(resourceType==4){
			params = {
				"resourceType":resourceType,
				"content":$("#news_content").val(),
				"descp":$("#news_descp").val(),
				"title":$("#news_title").val()
			};
		}else if(resourceType==5){
			params = {
				"resourceType":resourceType,
				"content":$("#picnews_content").val(),
				"descp":$("#picnews_descp").val(),
				"title":$("#picnews_title").val()
			};
		}else if(resourceType==6){
			params = {
				"resourceType":resourceType,
				"url":$("#video_url").val(),
				"type":"4",
				"descp":$("#video_descp").val(),
				"title":$("#video_title").val()
			};
		}
		$.post("resource_saveResource.do",params,function(data){
			if(data=="success"){
				$(".myline input").val("");
				$(".myline textarea").val("");
				$(".msg_info").text("发布资源成功");
				$(".msg_info").show();
				setTimeout(function(){
					$(".msg_info").empty();
					$(".msg_info").hide();
				},3000);
			}else{
				$(".msg_info").text("发布资源失败");
				$(".msg_info").show();
				setTimeout(function(){
					$(".msg_info").empty();
					$(".msg_info").hide();
				},3000);
			}
		});
	}
	</script>
</head>
<body style="background-color=transparent;width:100%;margin-left:0px;margin-top:0px;">
	<div id="bodydiv" style="background:url(../../image/bg/5.png)">
		<div id="tabscontent" >
			<div id="tab-1" class="subtab">
				<div class="tabtitle">我的资源</div>
				<div id="con_1" style="width:80%;padding-left:10%;float:left;" class="newscon">
					<div id="book_div" class="my_res" style="width:85%;height:140px;;margin-right:5%;margin-bottom:10px;float:left;">
						<div class="res_type" style="width:100%;height:20px;line-height:20px;margin-bottom:5px;">
							<img src="../../image/cover/others/white/MB_0007_book.png" style="width:20px;height:20px;float:left;" />
							<span style="height:20px;line-height:20px;float:left;margin-left:10px;font-size:16px;">小说</span>
						</div>
						<div class="user_info" style="width:100%;height:20px;line-height:20px;margin-bottom:10px;"></div>
						<div class="title_info" style="width:100%;height:20px;line-height:20px;font-size:14px;margin-bottom:5px;">STAR347工場萌偶像紗倉AV初體驗~</div>
						<div class="intro_info" style="width:100%;height:20px;line-height:20px;">工場萌えアイドル　紗倉まな　初イキッ！！ AV女優： 紗倉まな AVメーカー： ＳＯＤクリエイト（ソフトオンデマンド） AVレーベル： ＳＯＤｓｔａｒ 監督 ...</div>
					</div>
					<div id="comic_div" class="my_res" style="width:85%;height:100px;;margin-right:5%;margin-bottom:15px;float:left;">
					
					</div>
					<div id="music_div" class="my_res" style="width:85%;height:100px;;margin-right:5%;margin-bottom:15px;float:left;">
					
					</div>
					<div id="news_div" class="my_res" style="width:85%;height:100px;;margin-right:5%;margin-bottom:15px;float:left;">
					
					</div>
					<div id="picnews_div" class="my_res" style="width:85%;height:100px;;margin-right:5%;margin-bottom:15px;float:left;">
					
					</div>
					<div id="video_div" class="my_res" style="width:85%;height:100px;;margin-right:5%;margin-bottom:15px;float:left;">
					
					</div>
				</div>
			</div>
			<div id="tab-2" class="subtab">
				<div class="tabtitle">发布资源</div>
				<div class="msg_info" style="display:none;color: red;width:100%;height:20px;line-height:20px;text-align:center;"></div>
				<div id="con_2" style="width:80%;padding-left:10%;float:left;" class="newscon">
					<div class="myline" style="width:100%;height:40px;">
						<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">资源类型：</div>
						<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
							<select id="resourceType" style="height:20px;margin-top: 10px;margin-bottom: 10px;" onchange="changeType(this);">
								<option value="1">小说</option>
								<option value="2">漫画</option>
								<option value="3">音乐</option>
								<option value="4">新闻</option>
								<option value="5">图集</option>
								<option value="6">视频</option>		
							</select>
						</div>
					</div>
					<div id="div_1" class="con_div" style="width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="book_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">作者：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="book_author" name="author" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">章节：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="book_chapter" name="chapter" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="book_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">内容：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="book_content" name="content" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div id="div_2" class="con_div" style="display:none;width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="comic_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">作者：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="comic_author" name="author" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">章节：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="comic_chapter" name="chapter" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="comic_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">图片路径(多个图片路径请用;分割)：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="comic_urls" name="urls" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div id="div_3" class="con_div" style="display:none;width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="music_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="music_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">音乐路径(多个音乐路径请用;分割)：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="music_urls" name="urls" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div id="div_4" class="con_div" style="display:none;width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="news_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="news_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">内容：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="news_content" name="content" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div id="div_5" class="con_div" style="display:none;width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="picnews_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="picnews_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">内容：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="picnews_content" name="urls" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div id="div_6" class="con_div" style="display:none;width:100%;height:320px;">
						<div class="myline" style="width:100%;height:40px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">名称：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<input type="text" id="video_title" name="title" size="40" style="height:20px;margin-top: 10px;margin-bottom: 10px;" />
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">描述：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="video_descp" name="descp" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
						<div class="myline" style="width:100%;height:100px;">
							<div style="width:25%;height:40px;line-height:40px;text-align:right;float:left;">视频路径：</div>
							<div style="width:60%;height:40px;line-height:40px;text-align:left;float:left;">
								<textarea rows="4" cols="40" id="video_url" name="url" style="height:80px;margin-top: 10px;margin-bottom: 10px;"></textarea>
							</div>
						</div>
					</div>
					<div class="op_div" style="width:40%;height:40px;margin-left:30%;margin-right:30%;">
						<input type="button" onclick="sub();" value="确定" />
						<input type="button" onclick="reset();" value="重置" />
					</div>
				</div>
			</div>
		</div>
		<div id="leftButton" class="leftButton transparent_0" onclick="changeTab(-1);"><img title="上一个" src="images/left.png" /></div>
		<div id="rightButton" class="rightButton transparent_0" onclick="changeTab(1);"><img title="下一个" src="images/right.png" /></div>
	</div>
	
</body>
</html>